home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbfaqr01.zip / A86.DOC < prev    next >
Text File  |  1992-08-09  |  4KB  |  112 lines

  1. ;  Date: 07-31-92  22:35
  2. ;  From: Larry Teghtmeyer
  3. ;----------------------------------------------------------------------
  4. ;Ok, so I set down last night and came up with a couple of routines  and
  5. ;thought I would try them out and see if I could get them into my
  6. ;computer as good as they are in my head and here is what I came up with.
  7. ;Maybe you can use the information, but I know you can see it can be done
  8. ;with A86.  The first program is to be typed in or transfered to a text
  9. ;file.  I could suggest test.asm.
  10.  
  11. ;CUT HERE-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-
  12.  
  13.  
  14. PUBLIC a86test
  15.  
  16. data segment para public 'data'
  17. message1 db 'This text stored in the assembly data area'
  18. message1l equ $-message1
  19. row db 0
  20. col db 0
  21. attr db 0
  22. rowlen dw 160
  23.  
  24. code segment para public 'code'
  25. a86test:push bp               ;got to save it for qb later
  26. mov bp,sp                     ;now we can access the passed parameters
  27. push ds,es                    ;we are now saving DS and ES
  28. mov ax,seg message1
  29. mov es,ax
  30. mov si,[bp+6]                 ;lets get the attr calculated in qb
  31. mov ax,[si]
  32. mov es:attr,al
  33. mov si,[bp+8]                 ;get the integer val of col
  34. mov ax,[si]
  35. mov es:col,al                 ;store val of col in row
  36. mov si,[bp+10]                ;now get row
  37. mov ax,[si]
  38. mov es:row,al
  39. mov ax,[bp+12]                ;now we are going for the string passed 
  40. from qb
  41. mov bp,ax                     ;store the string location in bp
  42. mov ax,[bp]                   ;get the string len
  43. mov cx,ax                     ;put the string len into cx
  44. mov ax,[bp+2]
  45. mov bp,ax
  46. mov bh,0
  47. mov bl,es:attr
  48. mov dh,es:row                 ;remember this is 0 based instead of 1 
  49. based
  50. mov dl,es:col                 ;as in qb
  51. mov es,ds                ;a86 takes care of register to register transfer
  52. mov al,0
  53. mov ah,013                    ;the 0 in front of 13 makes this a hex 
  54. number
  55. int 010                       ;bios call to print string
  56.  
  57. mov cx,message1l              ;this routine will be a direct screen write
  58. mov es,0b800                  ;for b&w use 0b000
  59. mov ax,seg message1           ;get the segment address of our message
  60. mov ds,ax                     ;store it in ds
  61. lea si,message1               ;get the location of our message into si
  62. add row,2       ;we need to print the second string at a different 
  63. location
  64. mov al,row
  65. cbw                           ;make it into a word
  66. mul rowlen
  67. add al,col
  68. if c add ah,1
  69. add al,col                    ;this calculates the screen pos to print to
  70. if c add ah,1
  71. mov di,ax                     ;ES:DI = destination;DS:SI = sourse
  72. mov ah,attr
  73. m1:lodsb                      ;loads al with a byte from string
  74. stosw                         ; stores the word in screen memory
  75. loop m1                       ;do this cx times
  76. pop es,ds,bp                  ;one call to pop all trashed registers
  77. retf 4*2                      ;far ret for basic and clean up stack
  78.  
  79. ;CUT HERE-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-
  80. ;Notice there are no assumes, no memory management, no endp,no ends, no
  81. ;other extranious BS. Just code. You don't have to even declare the
  82. ;public names, but I do just so no other lables become public and can be
  83. ;used by other procedures.
  84. ;    Now you have the text file "test.asm".  Just tpye in from the DOS
  85. ;command line: A86 +o test.asm
  86. ;In an eyeblink, you wil have test.obj to play around with.  Make a
  87. ;library and .qlb in the normal manner from DOS. (ie. lib test,
  88. ;test.obj;) and (link /q test,etc).  I'm sorry, but *I* type in only what
  89. ;*I* need and then follow the prompts!  (I can't remember all the systax
  90. ;I need. (Sheepish grin))
  91. ;    Now that you have your new library, I have a small bit of qb code
  92. ;for you to test it out with:
  93.  
  94. ;CUT HERE-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-
  95.  
  96. DECLARE SUB a86test (a$, row%, col%, attr%)
  97. b$ = "This string stored in qb"
  98. row% = 5
  99. col% = 1
  100. attr% = 31       'BLUE backgroun,white foreground (or 16 * backgroung +
  101.                  'foreground
  102. COLOR 7, 1: CLS
  103. CALL a86test(b$, row%, col%, attr%)
  104.  
  105. CUT HERE-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-
  106.  
  107. 'load this into qb with the quick library created above and run it.  You
  108. 'may be *amaized* to see that it may even work!  Let me know how it turns
  109. 'out for you ...
  110. 'Type you later.
  111. '                                       Larry Teghtmeyer
  112.